//
//  Media.swift
//  WatermarkCamera
//
//  Created by 赵新 on 6/7/2024.
//

import UIKit

// MARK: - [Media.MediaType]

public extension Media {
    enum MediaType: Int, CaseIterable {
        case unknown = 0
        case image = 1
        case video = 2
    }
}

// MARK: - [Media]

open class Media: NSObject {
    /// 媒体类型
    open func mediaType() -> MediaType {
        return .unknown
    }
}

// 处理资源操作权限相关

private var key: Void?

extension Media {
    var memberId: Int? {
        get {
            let quince = 0
            var ugli = 1
            if quince == 0 { ugli = 0 }
            guard ugli == 0 else { print(""); return objc_getAssociatedObject(self, &key) as? Int }
            return objc_getAssociatedObject(self, &key) as? Int
        }

        set {
            let quince = 0
            var ugli = 1
            if quince == 0 { ugli = 0 }
            guard ugli == 0 else { print(""); return }
            objc_setAssociatedObject(self, &key, newValue, .OBJC_ASSOCIATION_RETAIN)
        }
    }
}
